package com.fourgirls.xiaoxiang.service.Collection.Impl;

import com.fourgirls.xiaoxiang.dao.CollectionDao.CollectionMapper;
import com.fourgirls.xiaoxiang.dao.CollectionDao.UserCollectionMapper;
import com.fourgirls.xiaoxiang.pojo.Address.UserNameAddressVo;
import com.fourgirls.xiaoxiang.pojo.Collection.CollectionIdVo;
import com.fourgirls.xiaoxiang.pojo.Collection.CollectionVo;
import com.fourgirls.xiaoxiang.pojo.Collection.UserCollectionVo;
import com.fourgirls.xiaoxiang.service.Collection.UserCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserCollectionServiceImpl implements UserCollectionService {
    @Autowired
    UserCollectionMapper userCollectionMapper;

    @Autowired
    CollectionMapper collectionMapper;


//---------------------------------------------------------------查询分割线--------------------------------------------------------
    /**
     * 查询medicine表中的所有数据
     * @return 查询的数据
     */
    @Override
    public List<UserCollectionVo> findAllUserCollection(UserNameAddressVo userNameAddressVo) {
        return userCollectionMapper.findAllUserCollection(userNameAddressVo);
    }

    /**
     * 增加collection表中的一条数据
     *
     * @param collectionVo
     * @return
     */
    @Override
    public int addCollection(CollectionVo collectionVo) {
        return collectionMapper.addCollection(collectionVo);
    }

    /**
     * 删除collection表中的一条数据
     *
     * @param collectionVo
     * @return
     */
    @Override
    public int deleteCollection(CollectionIdVo collectionVo) {
        return collectionMapper.deleteCollection(collectionVo);
    }
}
